import React from 'react'
import {useNavigate} from 'react-router-dom'

export default function Register() {
  //调用useNavigate
  const nav=useNavigate()
  const go=(e)=>{
    //取消默认行为
    e.preventDefault()
    nav("/login")
  } 
  return (
    <div>
      <h1>用户注册</h1>
      <span>已有账户,<a href='#' onClick={go}>请登录</a></span>
    </div>
  )
}
